Week 8: Input Devices
November 3 - November 10
[0] Overview
This week's assignments:
(1.) add a sensor to a microcontroller board that you have designed and read it
[1] Data Sheet for the ATTINY 1614
Having tried the ATTINYs for quite some time, I wanted to explore the process of bootloading the ATMEGAs to act similarly to the Arduino UNO R3s that I was used to. That way, I have different chips for different situations, especially when it comes to niche compatibility issues. I used the LIS3DH, which has a prebuilt sensor that is very accurate.
[2] Making the Board
This was relatively straightforward, except I forgot a critical part - the MOSI and other pins on the bottom of the package are acutally required to bootload. Witout that, I can't do it! Luckily, I was able to desolder it later on to be able to stick on jumpers wires delicately for 20 seconds for an ad-hoc solution. I didn't need those pins after the bootloading process, so this worked out. The milling wasn't done perfectly; it went a little too deep as you see the rough aspects of the PCB board, but it was still usable so that's all that mattered for me.
[3] Coding the Accelerometer
For this, I'm utilizing the Adafruit library that is provided with these chips, and flashed their software onto the board to check if it is working. To my surprise, even with the issues in bootloading, it provided some data!
[4] LIS3DH test!
LIS3DH found!
Range = 2G
Data rate set to: 400 Hz
X: 1056 Y: -304 Z: 15808 X: 0.64 Y: -0.18 Z: 9.70 m/s^2
X: 1056 Y: -272 Z: 15888 X: 0.67 Y: -0.17 Z: 9.73 m/s^2
X: 1088 Y: -208 Z: 15760 X: 0.67 Y: -0.13 Z: 9.66 m/s^2
X: 960 Y: -256 Z: 15888 X: 0.61 Y: -0.15 Z: 9.82 m/s^2
X: 1024 Y: -288 Z: 15888 X: 0.66 Y: -0.16 Z: 9.72 m/s^2
X: 1008 Y: -224 Z: 16048 X: 0.61 Y: -0.19 Z: 9.84 m/s^2
X: 1056 Y: -256 Z: 15840 X: 0.66 Y: -0.17 Z: 9.69 m/s^2
X: 1088 Y: -352 Z: 15824 X: 0.54 Y: -0.19 Z: 9.95 m/s^2
X: 1040 Y: -240 Z: 15744 X: 0.64 Y: -0.15 Z: 9.74 m/s^2
X: 1040 Y: -512 Z: 15840 X: 0.67 Y: -0.24 Z: 9.82 m/s^2
X: 1040 Y: -336 Z: 15888 X: 0.64 Y: -0.21 Z: 9.74 m/s^2
X: 1072 Y: -256 Z: 15840 X: 0.72 Y: -0.18 Z: 9.72 m/s^2
X: 1088 Y: -368 Z: 15760 X: 0.60 Y: -0.18 Z: 9.66 m/s^2
X: 992 Y: -304 Z: 15840 X: 0.63 Y: -0.21 Z: 9.67 m/s^2
X: 1088 Y: -288 Z: 15856 X: 0.68 Y: -0.19 Z: 9.72 m/s^2
X: 1024 Y: -272 Z: 15824 X: 0.68 Y: -0.20 Z: 9.82 m/s^2
X: 1072 Y: -240 Z: 15840 X: 0.66 Y: -0.21 Z: 9.85 m/s^2
X: 1008 Y: -272 Z: 15888 X: 0.66 Y: -0.18 Z: 9.62 m/s^2
X: 1056 Y: -304 Z: 15856 X: 0.65 Y: -0.19 Z: 9.88 m/s^2
X: 912 Y: -320 Z: 15648 X: 0.70 Y: -0.19 Z: 9.75 m/s^2
X: 1008 Y: -288 Z: 15808 X: 0.59 Y: -0.15 Z: 9.61 m/s^2